<template>
  <div id="">
    <headerbox :hasBack='true' :headerTitle="'我的行程'"></headerbox>
    <div v-for="elem in tripList" :key="elem.key">
      <activityItem :tripItem="elem"></activityItem>
    </div>
    <router-view class="childrenPage"></router-view>
  </div>
</template>
<script>
import {toChildrenPage} from '@/utils/util.js';
import {userTrip} from '@/utils/ajaxRequest.js';
export default {
  name: "",
  data: () => ({
    tripList:[],
  }),
  components: {
    activityItem:()=>import('./activityItem'),
  },
  methods: {
    // 发布
    publishEvent(data) {
      // console.log(data);
      toChildrenPage(this,'schedulPublish');
    },
    tabEvent(data) {
      console.log(data);
    }
  },
  mounted() {
    //do something after mounting vue instance
    let self = this;
    let xlyd_loginInfo = JSON.parse(window.localStorage.getItem('xlyd_loginInfo'));
    userTrip({token:xlyd_loginInfo.token}).then(res=>{
      console.log(res);
      if(res) {
        self.tripList = res.data.result;
      }
      // type类型：1： 我预约的订单2：预约我的订单3：我发布的赛事4 我参加的赛事
    })
  }
}
</script>
<style lang="scss" scoped>
</style>
